package hash.q1;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

public class test2215 {
    public static void main(String[] args) {
        int nums1[] = {1,1,2,3};
        int nums2[] = {2,2,4,6};
        Solution solution = new Solution();
        List<List<Integer>> list = solution.findDifference(nums1,nums2);
        System.out.println(list);
    }
}
class Solution {
    public List<List<Integer>> findDifference(int[] nums1, int[] nums2) {
        List<List<Integer>> list = new ArrayList<>();
        Set<Integer> set1 = new HashSet<>();
        Set<Integer> set2 = new HashSet<>();
        List<Integer> l1=new ArrayList<>();
        List<Integer> l2=new ArrayList<>();
        for(int i=0;i<nums1.length;i++){
            set1.add(nums1[i]);
        }
        for(int i=0;i<nums2.length;i++){
            set2.add(nums2[i]);
        }
        for(int n:nums1){
            set2.remove(n);
        }
        for(int n:nums2){
            set1.remove(n);
        }
      list.add(new ArrayList<>(set1));
        list.add(new ArrayList<>(set2));

        return list;
    }
}
